﻿@model HeaderLinksModel
@using Nop.Web.Models.Common;

<div id="tw1-box">
    <div class="tw1-container-box">
            <div class="links">
                <ul>
                    @Html.Widget("header_links_before")
                    <li><a href="/"><img src="@Url.Content("~/Content/images/home.png")"></a></li>
                    @if (Model.AllowPrivateMessages)
                    {
                        <li><a href="@Url.RouteUrl("PrivateMessages", new { tab = "" })" class="ico-inbox">@T("PrivateMessages.Inbox")</a>
                            @Model.UnreadPrivateMessages</li>
                        if (!string.IsNullOrEmpty(Model.AlertMessage))
                        {
                        <script type="text/javascript">
                            $(document).ready(function () {
                                displayPopupNotification('@(Model.AlertMessage)', 'success', false);
                            });
                        </script>
                        }
                    }
                  @*  @if (Model.ShoppingCartEnabled)
                    {
                        <li>
                            <a href="@Url.RouteUrl("ShoppingCart")" class="ico-cart">
                                <span class="cart-label">@T("ShoppingCart")</span>
                                <span class="cart-qty">@T("ShoppingCart.HeaderQuantity", Model.ShoppingCartItems, Model.SubTotal)</span>
                            </a>
                        </li>
                    }*@
                    <li><a href="@Url.RouteUrl("CustomerInfo")">@T("Account.MyAccount")</a></li>
                    @if (Model.WishlistEnabled)
                    {
                        <li>
                            <a href="@Url.RouteUrl("Wishlist")" class="ico-wishlist">
                                <span class="cart-label">@T("Wishlist")</span>
                                <span class="wishlist-qty">@T("Wishlist.HeaderQuantity", Model.WishlistItems)</span>
                            </a>
                        </li>
                    }
                    @Html.Widget("header_links_after")
                </ul>
   
            </div>
            <div id="welcome">
                @if (Model.IsAuthenticated)
                {
                    <a href="@Url.RouteUrl("CustomerInfo")" class="account">@Model.CustomerEmailUsername</a>
                    <span>&nbsp;|&nbsp;</span>        
                    <a href="@Url.RouteUrl("Logout")" class="ico-logout">@T("Account.Logout")</a>
                }
                else
                {
                    <a href="@Url.RouteUrl("Register")" class="ico-register">@T("Account.Register")</a>
                    <span>&nbsp;|&nbsp;</span>        
                    <a href="@Url.RouteUrl("Login")" class="ico-login">@T("Account.Login")</a>
                }
            </div>

    </div>
</div>
<div id="tw2-box">
    <div class="tw2-container-box">
        <div id="header">
            @Html.Widget("header")
            <div id="logo">
                <a href="@Url.RouteUrl("HomePage")">
                    <img src="@Url.Content("~/Content/images/logoviethair.png")" title="Viet hair import export join stock company" alt="Viet hair import export join stock company">
                </a>
            </div>
            <div class="alibaba" style="position: absolute;left: 260px;top: 15px;">                    
                <div>
                    Click here to visit my alibaba
                </div>
                <div>
                    <a target="_bank" href="http://viethair.trustpass.alibaba.com/"><img src="@Url.Content("~/Content/images/alibaba.png")" title="Viet hair import export join stock company" alt="Viet hair import export join stock company"></a>
                </div>
            </div>               
            <div id="currency">
                Currency<br>
                @Html.Action("CurrencySelector", "Common")
            </div>
            <div id="search">
                @Html.Action("SearchBox", "Catalog")
            </div>
            <div id="cart">
                <div class="heading">
                     <div id="topcartlink">
                         <h4>@T("ShoppingCart")</h4>
                        <a href="@Url.RouteUrl("ShoppingCart")">                            
                            <span id="cart-total" class="cart-qty">@T("ShoppingCart.HeaderQuantity", Model.ShoppingCartItems, Model.SubTotal) </span>
                        </a>
                    </div>
                </div>
                @Html.Action("FlyoutShoppingCart", "ShoppingCart")
            </div>
            <div class="header-selectors-wrapper">
                <div class="tax-display-type-selector">
                    @Html.Action("TaxTypeSelector", "Common")
                </div>
                
                <div class="language-selector">
                    @Html.Action("LanguageSelector", "Common")
                </div>
                @Html.Widget("header_selectors")
            </div>
       </div>
    </div>
</div>
@if (Model.ShoppingCartEnabled)
{
    <script type="text/javascript">
        $(document).ready(function () {
            $('#header').on('mouseenter', '#topcartlink', function () {
                $('#flyout-cart').addClass('active');
            });
            $('#header').on('mouseleave', '#topcartlink', function () {
                $('#flyout-cart').removeClass('active');
            });
            $('#header').on('mouseenter', '#flyout-cart', function () {
                $('#flyout-cart').addClass('active');
            });
            $('#header').on('mouseleave', '#flyout-cart', function () {
                $('#flyout-cart').removeClass('active');
            });

        });
    </script>
}
